<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <script>
        // 补充：在JS中，变量在使用时可以不写var
        // 不写var直接赋值，相当于给window的某个属性直接赋值

        a = 1;
        console.log(a, window.a);
    </script>
</body>
</html>